import type { PiniaPluginContext } from 'pinia'
import _ from 'lodash'
export const piniaPlugin = (context: PiniaPluginContext) => {
  const state = _.cloneDeep(context.store.$state)
  return {
    $reset: () => {
      context.store.$patch(_.cloneDeep(state))
    }
  }
}